package org.yaac.shared.stat;

import java.io.Serializable;
import java.util.Map;

import org.yaac.shared.stat.models.Kind;
import org.yaac.shared.stat.models.KindIsRootEntity;
import org.yaac.shared.stat.models.KindNonRootEntity;
import org.yaac.shared.stat.models.NSPropertyTypePropertyNameKind;
import org.yaac.shared.stat.models.Total;

/**
 * wrapper class wrapping all stat
 * 
 * @author Max Zhu (thebbsky@gmail.com)
 *
 */
public class StatDTO implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	/**
	 * @author Max Zhu (thebbsky@gmail.com)
	 *
	 */
	public static class KindWrapper implements Serializable {
		/**
		 * 
		 */
		private static final long serialVersionUID = 1L;

		private Kind kind;
		
		private KindIsRootEntity rootKind;
		
		private KindNonRootEntity nonRootKind;

		public Kind getKind() {
			return kind;
		}

		public KindIsRootEntity getRootKind() {
			return rootKind;
		}

		public KindNonRootEntity getNonRootKind() {
			return nonRootKind;
		}

		public void setKind(Kind kind) {
			this.kind = kind;
		}

		public void setRootKind(KindIsRootEntity rootKind) {
			this.rootKind = rootKind;
		}

		public void setNonRootKind(KindNonRootEntity nonRootKind) {
			this.nonRootKind = nonRootKind;
		}
	} 
	
	/**
	 * total stat
	 */
	private Total total;
		
	/**
	 * kinds per namespace breakdown
	 */
	private Map<String, Iterable<KindWrapper>> nsKindsMap;
	
	/**
	 * properties detail per namespace breakdown
	 */
	private Map<String, Iterable<NSPropertyTypePropertyNameKind>> nsPropertyMap;
	
	/**
	 * used by GWT
	 */
	@SuppressWarnings("unused")
	private StatDTO(){};
	
	/**
	 * @param total
	 * @param nsKindsMap
	 * @param nsPropertyMap
	 */
	public StatDTO(Total total, 
			Map<String, Iterable<KindWrapper>> nsKindsMap,
			Map<String, Iterable<NSPropertyTypePropertyNameKind>> nsPropertyMap) {
		super();
		this.total = total;
		this.nsKindsMap = nsKindsMap;
		this.nsPropertyMap = nsPropertyMap;
	}
	
	public Total getTotal() {
		return total;
	}

	public Map<String, Iterable<KindWrapper>> getNsKindsMap() {
		return nsKindsMap;
	}

	public Map<String, Iterable<NSPropertyTypePropertyNameKind>> getNsPropertyMap() {
		return nsPropertyMap;
	}
}
